package name.vaccari.matteo.tai.chat.views;

import java.util.Iterator;
import java.util.List;

import name.vaccari.matteo.tai.chat.domain.Message;

public class ChatView {
	
	private List<Message> messages;
	
	public void setMessages(List<Message> messages){
		this.messages = messages;
	}
	
	public String toString(){
		String html = "<ul>";
		Iterator<Message> iterator = messages.iterator();
		while (iterator.hasNext()){
			Message message = iterator.next();
			html += "<li>"+ message.getText()+"</li>";
		}
		html += "</ul>";
		return html;
		
	}

}
